package openadmin.controller.gwt.beaninfo;

import java.io.Serializable;
/**
 * <desc> DependsOn: This information is based in the on-change event. If the independent attributes change
 *        then the listBox HSQL will change.
 * 
 * <example> 	attributeName="town"
 * 				dependentAttributes={"town.province.id"}
 *  			independentValues={"province.id"}
 *  			where province is a class of type Province and town is a class of type Town
 *  
 *              In this example, we are referring to a field "town" of type Town (a class but we are retrieving only town.id). 
 *              We are displaying a List Box that contains all the towns from a specified province. 
 *              The HSQL sentence in the List Box may be this one: 
 *                "SELECT town.id, town.description FROM Town town where town.province.id=?".
 *              
 *              However, we are also displaying a field province of type "Province" (a class, but we are retrieving only province.id).
 *              When province (province.id) changes, an OnChange event should be raised and the "province.id" should be injected in
 *                the List Box HSQL sentence and should be refreshed the "town" List Box 
 *              
 *              
 *  
 * In order to simplify programming, all the attributes have been declared "public"
 * @author edu
 *
 */
public class DependsOn implements Serializable {
	
	private static final long serialVersionUID = 1L;  // To avoid compiler warnings
	
	public String attributeName;		// The name of the field that changes when another field changes
	public String[] dependentAttributes;// The fields (attributes) from this attribute that are conditioned 
	public String[] independentValues;	// The values the previous attributes can have (it can be a constant or another attribute)
										//  if a field in the attributeValue changes then the query in the listbox of the attributeName
										//  will change
}
